<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('活动计划')" />
	<th:block th:include="include :: businessCSS" />
</head>
<style>
.layui-card-header {border:0}
.layui-elem-quote{border-left: 0;margin:-16px -16px 16px -16px}
.mid-content{margin: 32px 16px 0px 0px;}
</style>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
		<form class="layui-form head-form">
		    <div class="north">
                <th:block th:include="include :: business_btn" />
	        	<th:block th:include="include :: business_tpl('top')" />
	        	<div id="actInfo" style="display:none">
<!--			    	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">-->
<!--						<legend>活动实际信息</legend>-->
<!--					</fieldset>-->
					<div class="layui-form layui-card-header layuiadmin-card-header-auto" style="width:calc(100% - 30px);top: 16px">
						<blockquote class="layui-elem-quote"><b>活动实际信息</b></blockquote>
						<div class="layui-form-item margin_t0">
							<div class="layui-inline margin_r0 layui-col-sm4">
				               	<label class="layui-form-label">是否完成：</label>
				               	<div class="layui-input-block">
				               		<select name="vIsFinish" id="vIsFinish" class="layui-select" lay-filter="vIsFinish" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('sfwc')}">
										<option value="">请选择</option>
										<option th:each="dict : ${type}" th:text="${dict.vname}" th:data-guid="${dict.guid}" th:value="${dict.vid}"></option>
									</select>
								</div>
				            </div>
							<div class="layui-inline margin_r0 layui-col-sm4">
				               	<label class="layui-form-label">协助技术：</label>
				               	<div class="layui-input-block">
				                    <input type="text" name="vAssistUser" id="vAssistUser" value="" class="layui-input" autocomplete="off">
								</div>
				            </div>
							<div class="layui-inline margin_r0 layui-col-sm4">
				               	<label class="layui-form-label">实际费用：</label>
				               	<div class="layui-input-block">
				                    <input type="number" name="fActualJe" id="fActualJe" value="" class="layui-input" autocomplete="off" lay-verify="number">
								</div>
				            </div>
							<div class="layui-inline margin_r0 layui-col-sm4">
				               	<label class="layui-form-label">实际人数：</label>
				               	<div class="layui-input-block">
				                    <input type="number" name="fActualRs" id="fActualRs" value="" class="layui-input" autocomplete="off" lay-verify="number">
								</div>
				            </div>
							<div class="layui-inline margin_r0 layui-col-sm4">
								<label class="layui-form-label"></label>
				               	<div class="layui-input-block"></div>
							</div>
							<div class="layui-inline margin_r0 layui-col-sm4">
								<label class="layui-form-label"></label>
				               	<div class="layui-input-block" style="text-align: center;"><button class="layui-btn layui-btn-sm tp-save saveAct" style="display:none">保存 - 实际信息</button></div>
				            </div>
						</div>
					</div>
				</div>
	    	</div>
		    <div class="mid-content">
		        <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
		    </div>
			<th:block th:include="include :: pageFooter" /> 
		</form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<!-- 商机审核 -->
<script id="change1" type="text/template">
<table class="layui-hide" id="dhtable_c" lay-filter="ftable_c"></table>
</script>
<th:block th:include="include :: inlineJS" />
<script th:inline="javascript">
/*<![CDATA[*/
var nowTimeStr = [[${nowTimeStr}]],
	weekStartTime =[[${weekStartTime}]],
	weekEndTime =[[${weekEndTime}]],
	checkProcessTask =[[${checkProcessTask}]];
/*]]>*/
</script>
<script type="text/javascript">
nowTimeStr = (new Date(Date.parse(nowTimeStr.replace(/-/g,"/"))).getTime())/1000;
//市场审批或审批结束  显示活动实际信息
if(($("#activeFlow").val() == 'FlowSc' && checkProcessTask == '1') || $("#activeFlow").val() == 'end')$("#actInfo").css('display','');
var $,layer,form,table,laydate,element;//定义layui模块
eachFields();//明细表格中的字段遍历
if(!!$("#fXsFpsl_select").val())$("#fXsFpsl").val($("#fXsFpsl_select").val());//默认税率赋值至input
layui.use(['laydate', 'table','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,table = layui.table,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	layui.element.render();
 	$.get(moduleUrl+"/listbynid?nid="+nid,function(data){
		$.each(data.data,function(k,v){
			dataStr.push(v);
		});
		initTable();//初始化表格
	});
 	$.each(t_fields,function(v,k){//初始赋值——主表
 		$('#'+k.fields).val(k.fieldContent);
 	})
	form.render();
 	if($("#activeFlow").val() == 'end'){
 		$("#actInfo input").attr("readonly",true).addClass("canntEdit");
 		$("#actInfo select").next().find("i").remove();
 		$("#actInfo select").next().find("dl").remove();
 	}else{
 		$(".saveAct").css('display','');
 	}
	toolbarEvent();//通用表格头部工具栏事件监听
	monitorSort();//监听排序——重载赋值渲染
})
$(".saveAct").click(function(){
	var pd=[];
	pd.push({"nid":$("#nid").val(),"vIsFinish":$("#vIsFinish").val(),"vAssistUser":$("#vAssistUser").val(),"fActualJe":$("#fActualJe").val(),"fActualRs":$("#fActualRs").val()})
	var postData = {'infoItems':JSON.stringify(pd)};//转化为json字符串格式
	$.operate.post(moduleUrl+'/pfpost', postData, function(res){
		console.log(res)
        if(res.code != 0){
        	layer.msg(fieldName+'保存失败！');
        }
    });
})
</script>
</body>
</html>